package beans;

import entities.Pacchettoviaggio;
import controllers.PacchettoviaggioFacade;
import java.io.Serializable;
import javax.annotation.PostConstruct;
import javax.faces.event.ActionEvent;
import javax.inject.Named;
import javax.inject.Inject;
import javax.faces.view.ViewScoped;

@Named(value = "pacchettoviaggioController")
@ViewScoped
public class PacchettoviaggioController extends AbstractController<Pacchettoviaggio> implements Serializable {

    @Inject
    private PacchettoviaggioFacade ejbFacade;

    public PacchettoviaggioController() {
        super(Pacchettoviaggio.class);
    }

    @PostConstruct
    public void init() {
        super.setFacade(ejbFacade);
    }

    @Override
     public void saveNew(ActionEvent event) {
        super.selected.setIdPacchettoViaggio(Integer.MAX_VALUE);
        super.selected.setQuantita(1);
        super.saveNew(event);
    }
}
